import ollama
from ollama import chat

stream = chat(
    model='qwen2.5:7b',
    messages=[{'role': 'user', 'content': '为什么天空是蓝色的？'}],
    stream=True,
)

for chunk in stream:
    print(chunk['message']['content'], end='', flush=True)

